﻿using System;
using System.Collections.Generic;
using System.Text;

namespace WebSEClassLibrary
{
    /// <summary>
    /// 对话,某一个场景的对话由一个对话的一棵树构成
    /// </summary>
    public abstract class Dialog
    {
        /// <summary>
        /// 该对话的唯一标志
        /// </summary>
        private int dialogId;

        public int DialogId
        {
            get { return dialogId; }
            set { dialogId = value; }
        }
        /// <summary>
        /// 该话由dialogPerson说
        /// </summary>
        private Person dialogPerson;

        public Person DialogPerson
        {
            get { return dialogPerson; }
            set { dialogPerson = value; }
        }
        /// <summary>
        /// 对话的内容
        /// </summary>
        private string dialogText;

        public string DialogText
        {
            get { return dialogText; }
            set { dialogText = value; }
        }
        /// <summary>
        /// 该对话是否结束
        /// </summary>
        private bool isTerminal;

        public bool IsTerminal
        {
            get { return isTerminal; }
            set { isTerminal = value; }
        }

        #region 公用方法
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="id">对话框的ID(唯一标记)</param>
        public Dialog(int id)
        {
            //从XML中读取关于该dialog的相关信息
        }
        /// <summary>
        /// 定义虚函数
        /// </summary>
        /// <param name="choiceId"> 选择的ID,当是ChoiceDialog时,就用该ID来决定下一个ID是什么,当是CommonDialog时,该ID没用,缺省为0</param>
        /// <returns>下一个对话</returns>
        public abstract Dialog getNextDialog(int choiceId);
        #endregion
    }
}
